package com.springframework.scope;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ScopeRun {
    private static final Logger logger = (Logger) LogManager.getLogger(ScopeRun.class);
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("com.springframework/scope/bean.xml");
        ScopeBean scopeBean = context.getBean("scopeBean", ScopeBean.class);
        System.out.println(scopeBean);
        logger.info(scopeBean);
        logger.error("错误日志使用！");
    }
}
